home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Compilers⁄Interps / GCC-2.3.3r12 / Tests / loop.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-03-01  |  1.2 KB  |  63 lines  |  [TEXT/MPS ]

  1. int target_flags;
  2.  
  3. main() {
  4.   set_target_switch("");
  5. }
  6.  
  7. struct {char *name; int value;} target_switches []
  8.   = { { "68020", 5},    
  9.   { "c68020", 5},    
  10.   { "68881", 2},    
  11.   { "c68881", 2},    
  12.   { "bitfield", 4},    
  13.   { "68000", -5},    
  14.   { "c68000", -5},    
  15.   { "soft-float", -0102},    
  16.   { "nobitfield", -4},    
  17.   { "rtd", 8},    
  18.   { "nortd", -8},    
  19.   {"short", 040},    
  20.   { "noshort", -040},    
  21.   { "fpa", 0100},    
  22.   { "nofpa", -0100},    
  23.   { "sky", 0200},    
  24.   { "nosky", -0200},    
  25.   { "68040", 0407},    
  26.   { "68030", -01400},    
  27.   { "68030", 7},    
  28.   { "68040-only", 01000},    
  29.   { "bgfull", 0x2000 }, 
  30.   { "bgoff", -0x2000 }, 
  31.   { "elems881", 0x4000}, 
  32.   { "m", 0x8000}, 
  33.   { "sane", 0x10000 }, 
  34.   { "insane", -0x10000 }, 
  35.   { "nointlib", -0x20000 }, 
  36.   { "b", 0x40000 }, 
  37.   { "fx30", 0x80000 }, 
  38.   { "noseg", 0x100000 }, 
  39.   { "", 0x32000 }} ;
  40.  
  41. int
  42. set_target_switch (name)
  43.      char *name;
  44. {
  45.   register int j;
  46.   int valid = 0;
  47.  
  48.   for (j = 0; j < 32; j++)
  49.     if (!strcmp (target_switches[j].name, name))
  50.       {
  51.     if (target_switches[j].value < 0)
  52.       target_flags &= ~-target_switches[j].value;
  53.     else
  54.       target_flags |= target_switches[j].value;
  55.     valid = 1;
  56.       }
  57.  
  58.  
  59.   if (!valid)
  60.     printf ("Invalid option7 `%s'", name);
  61. }
  62.  
  63.